public class Computer {
    void open(){
        System.out.println("开机");
    }

    void close(){
        System.out.println("关机");
    }

    void useDevice(IUSB usb){
        usb.deviceOpen();
        if(usb instanceof  Mouse){
            Mouse mouse = (Mouse) usb;
            mouse.click();
        }else if(usb instanceof KeyBorad){
            KeyBorad keyBorad = (KeyBorad) usb;
            keyBorad.printKeyBorad();
        }
        usb.deviceClose();
    }
}
